package com.lipiao.traveltreasure.service.impl.travelTreasure;

import com.lipiao.traveltreasure.bean.travelTreasureBean.ActivityBean;
import com.lipiao.traveltreasure.dao.traveltreasure.ActivityMapper;
import com.lipiao.traveltreasure.service.travelTreasure.ActivityService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * ActivityService实现类
 */
@Service
@Transactional
public class ActivityServiceImpl implements ActivityService {

    //注入Mapper接口对象
    @Resource
    private ActivityMapper activityMapper;

    @Override
    public int add(ActivityBean activityBean) {
        return activityMapper.insert(activityBean);
    }

//    @Override
//    public void addword(Word word) {
//        activityMapper.addword(word);
//    }

    @Override
    public ActivityBean findById(Long activityId) {
        return null;
    }

    @Override
    public List<ActivityBean> findBySellerId(String sellerId) {
        return activityMapper.findBySellerId(sellerId);
    }


    @Override
    public List<ActivityBean> findAll() {
        return activityMapper.selectAll();
    }

    @Override
    public int modify(ActivityBean activityBean) {
        return activityMapper.updateById(activityBean);
    }

    @Override
    public int delete(long id) {
        return activityMapper.deleteById(id);
    }

    @Override
    public int delete(String sellerId, long activityId) {
        return 0;
    }
}
